﻿<%@ Page Language="C#" MasterPageFile="~/manager/page/ManagerMasterPage.Master" AutoEventWireup="true" CodeBehind="removeuser.aspx.cs" Inherits="Com.Web.coffinegurunaru.manager.user.removeuser"%>
<%@ Register TagPrefix="UC" TagName="Menu" Src="~/manager/user/menu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phHead" runat="server">
<link rel="StyleSheet" href="/css/jquery-ui.css" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phContent" runat="server">
<hr />
<br />
<table>
<tr>
	<td valign="top">
<UC:Menu SubPageType=2 runat="server" />
	</td>
	<td style="width:20px;"></td>
	<td>
<table cellpadding="0" cellspacing="1" style="background-color:Gray; width:100%;" id="m_UserSearch">
<tr>
	<td style="background-color:Silver; text-align:center; height:25px;">내/외국인</td>
	<td style="background-color:#ffffff;">&nbsp;&nbsp;
		<select style="width:200px" class="m_LocalUserType">
			<option value="">선택안함</option>
			<option value="Y">내국인</option>
			<option value="N">외국인</option>
		</select>
	</td>
</tr>
<tr>
	<td style="background-color:Silver; text-align:center; height:25px;">그룹검색</td>
	<td style="background-color:#ffffff;">&nbsp;&nbsp;
		<select style="width:200px" class="m_GroupType">
			<option value="0">선택안함</option>
			<option value="1">운영자 [ 존재하지 않음]</option>
			<option value="2">회원</option>
			<option value="3">가맹점</option>
		</select>
	</td>
</tr>
<tr>
	<td style="background-color:Silver; text-align:center; height:25px;">날짜검색</td>
	<td style="background-color:#ffffff;">&nbsp;&nbsp;
		<input type="text" class="m_DateJoin_Start" readonly="readonly" style="width:90px;" /> ~ <input type="text" class="m_DateJoin_End" readonly="readonly" style="width:90px;" />
		&nbsp;&nbsp;&nbsp;<input type="button" class="m_DateJoin_Remove" value="날짜삭제" />
	</td>
</tr>
<tr>
	<td style="background-color:Silver; text-align:center; height:25px;">검색</td>
	<td style="background-color:#ffffff;">&nbsp;&nbsp;
		<select style="width:100px" class="m_SearchType">
			<option value="0">선택안함</option>
			<option value="1">아이디</option>
			<option value="2">이름</option>
		</select>&nbsp;&nbsp;
	<input type="text" class="m_SearchValue" style="width:200px;"/></td>
</tr>
<tr>
	<td colspan="2" style="background-color:#ffffff; text-align:center;"><input type="button" id="m_btnSearch" class="m_btnSearch" value="검색" /></td>
</tr>
</table>
<br />

<table width="100%">
<tr>
	<td style="text-align:right;">한페이지 개수 : 
		<select id="selPageSize">
			<option value="10">10</option>
			<option value="20">20</option>
			<option value="30">30</option>
			<option value="50">50</option>
			<option value="100">100</option>
		</select>
	</td>
</tr>
<tr>
	<td align="center">
		<div id="m_UserList" ></div>
		<br />
		<div id="m_Pager"></div>
	</td>
</tr>
</table>

	</td>
</tr>
</table>
<script language="javascript" type="text/javascript">
(function($){
	$.Member = {};
	
	$.Member = {
		Init : function() {
			$("#m_Pager").pager({
				pageSize : 10,
				useCallback : true,
				pageNo : 1,
				callback:function(pageNo) {
					$.Member.GetList();
				}
			});
			$("#m_UserSearch input.m_DateJoin_Start").datepicker({
				showButtonPanel: true
			});
			$("#m_UserSearch input.m_DateJoin_Start").datepicker( "option", "dateFormat", "yy-mm-dd" );

			$("#m_UserSearch input.m_DateJoin_End").datepicker({
				showButtonPanel: true
			});
			$("#m_UserSearch input.m_DateJoin_End").datepicker( "option", "dateFormat", "yy-mm-dd" );
			
			$("#m_UserSearch input.m_DateJoin_Remove").click(function() {
				$("#m_UserSearch input.m_DateJoin_Start").val( "" );
				$("#m_UserSearch input.m_DateJoin_End").val( "" );
			});
			
			$("#m_UserSearch select.m_LocalUserType").change(function() {
				$("#m_UserSearch input.m_DateJoin_Remove").click();
				$("#m_UserSearch select.m_SearchType").val( 0 );
				$("#m_UserSearch input.m_SearchValue").val( "" );
				$("#m_Pager").pager("option", "currentPageNo", 1);
				$.Member.GetList();
			});
			
			$("#m_UserSearch select.m_GroupType").change(function() {
				$("#m_UserSearch input.m_DateJoin_Remove").click();
				$("#m_UserSearch select.m_SearchType").val( 0 );
				$("#m_UserSearch input.m_SearchValue").val( "" );
				$("#m_Pager").pager("option", "currentPageNo", 1);
				$.Member.GetList();
			});
			
			$("#m_UserSearch input.m_btnSearch").click(function() {
				if ( $("#m_UserSearch input.m_SearchValue").val() != 0 )
				{
					if ( $.trim($("#m_UserSearch input.m_SearchValue").val()) == "" )
					{
						alert( "검색할 내용을 입력하세요" );
						return;
					}
				}
				$("#m_Pager").pager("option", "currentPageNo", 1);
				$.Member.GetList();
			});
			
			$("#selPageSize").change(function() {
				$("#m_Pager").pager("option", "pageSize", $(this).val())
				$("#m_Pager").pager("option", "currentPageNo", 1);
				$.Member.GetList();
			});
			
			$.Member.GetList();
		},
		
		GetList : function() {
			var IsLocalUser = $("#m_UserSearch select.m_LocalUserType").val();
			var nGroupType = $("#m_UserSearch select.m_GroupType").val();
			var strDateJoin_start = $("#m_UserSearch input.m_DateJoin_Start").val();
			var strDateJoin_end = $("#m_UserSearch input.m_DateJoin_End").val();
			var SearchType = $("#m_UserSearch select.m_SearchType").val();
			var SearchValue = $("#m_UserSearch input.m_SearchValue").val();

			$("#m_UserList").ajaxNet(
			"/manager/user/userMethod.aspx?_vb=GetListByRemove",
			{
				"PageNo" : $("#m_Pager").pager("option", "currentPageNo"),
				"PageSize" : $("#m_Pager").pager("option", "pageSize"),
				"IsLocalUser" : IsLocalUser,
				"nGroupType" : nGroupType,
				"strDateJoin_start" : strDateJoin_start,
				"strDateJoin_end" : strDateJoin_end,
				"SearchType" : SearchType,
				"SearchValue" : SearchValue
			}, function(results, context)
			{
				$("#m_UserList").html( results[ 0 ] );
				$("#m_Pager").pager("update", results[1]);
				
				$("#m_UserList input.m_Restore").click(function() {
					$.Member.Restore( $(this).closest("tr") );
				});
			});
		},
		
		Restore : function( $tr )
		{
			var data = $tr.tagdata();
			if ( confirm( "정말로 복구 처리하시겠습니까?" ) )
			{
				$("#m_UserList").ajaxNet(
				"/manager/user/userMethod.aspx?_vb=Restore",
				{
					"UserNo" : data.UserNo
				}, function(results, context)
				{
					$.Member.GetList();
				});
			}
		}
	};
	
	$(function() {
		$.Member.Init();
	});
})(jQuery);

</script>

</asp:Content>
